import 'package:get/get.dart';

import 'package:easy_go/routes/app_routes.dart';
import 'package:easy_go/data/model/my_model.dart';
import 'package:easy_go/test/test_req/test_api.dart';

class HomeController extends GetxController {
  //
  final _postsList = <MyModel>[].obs;
  get postList => _postsList;
  set postList(value) => _postsList.value = value;
  //
  final _post = MyModel().obs;
  get post => _post.value;
  set post(value) => _post.value = value;
  //
  getAll() {
    MyApiClient().getAll().then((data){ postList = data; });
  }
  //
  details(post) {
    this.post = post;
    Get.toNamed(AppRoutes.detail);
  }
}